using Configuration.DataBase.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Configuration.DataBase.Data.Configurations
{
	public class SettingConfiguration : IEntityTypeConfiguration<Settings>
	{
		public void Configure(EntityTypeBuilder<Settings> builder)
		{
			builder.ToTable("Settings");
			builder.HasKey(s => s.Id);
			builder.Property(s => s.Id)
				.ValueGeneratedOnAdd();
			builder.Property(s => s.Name)
				.HasMaxLength(255)
				.IsRequired();
			builder.Property(s => s.Value)
				.HasMaxLength(255)
				.IsRequired();
		}
	}
}
